#ifndef __TEXTSCENENODE_H__
#define __TEXTSCENENODE_H__

#include "../include/ISceneNode.h"
#include "SceneGenerator.h"
#include "../include/ITextSceneNode.h"
#include "../include/IFont.h"
#include "LetterSceneNode.h"

typedef std::vector<CLetterSceneNode*>	VectorLetterType;

class CTextSceneNode : public ITextSceneNode
{
private:
	VectorLetterType VectorLetter;
	stringc Text;
	vector3dvpos PositionAligned;
	vector2dvpos TextSize;
	AlignementX ax;
	AlignementY ay;
	vector2dvpos Space;
	vPos Points;
protected:
	CSceneGenerator *sg;
	IFont *TxtFont;
public:
	CTextSceneNode(IFont *fnt,stringc Text,AlignementX ax,AlignementY ay,vector2dvpos nSpace,vPos nPoints,ISceneNodeBasicParamsDeclaration);
	virtual ~CTextSceneNode();

	virtual void Render(IDrawableFaceManager *dfm);

	virtual void SetText(stringc newText="");
	virtual const stringc &GetText();
	virtual void SetPositionAligned(vector3dvpos &nv);
	virtual void SetPositionAlignedX(vPos nv);
	virtual void SetPositionAlignedY(vPos nv);
	virtual void SetPositionAlignedZ(vPos nv);
	virtual void SetAlignementX(AlignementX ax=ALIGNEMENT_X_CENTER);
	virtual void SetAlignementY(AlignementY ay=ALIGNEMENT_Y_MIDLE);
	virtual void ReUpdate();
	virtual void SetSpace(vector2dvpos &nv);
	virtual void SetSpaceX(vPos nv=0.0);
	virtual void SetSpaceY(vPos nv=0.0);
	virtual const vector2dvpos &GetTextSize()	{	return TextSize;	}
	virtual vPos GetTextSizeW()					{	return TextSize.X;	}
	virtual vPos GetTextSizeH()					{	return TextSize.Y;	}
	virtual void SetForeColor(CColor &color);
	virtual void SetBackColor(CColor &color);

	virtual CLetterSceneNode *GetNewLetter(s8 Letter,IFont *Font);
	virtual void SetMaterialAmbients(CColor &Color);

	virtual void OnRender()
	{

	}
};

#endif
